package cn.micai.base.thread;

/**
 * 描述：
 * <p>
 *
 * @author: 赵新国
 * @date: 2018/2/22 11:05
 */
public class RunThread  extends Thread {

    private int num = 0;

    public void setNum(int num) {
        System.out.println(this.num);
        this.num = num;
    }

    @Override
    public void run(){
        System.out.println(num);
    }

    public static void main(String [] args) {
        RunThread t1 = new RunThread();
        t1.setNum(10);
        t1.start();
        try {
            Thread.sleep(1000);
        } catch (Exception e) {
            e.printStackTrace();
        }
        RunThread t2 = new RunThread();
        t2.setNum(20);
        t2.start();
    }
}
